< previous page page_498 next page >

Page 498
By the time you are through with today's lesson, you will be able to use SQL keywords to perform the following tasks:
· Create and delete data tables with the CREATE TABLE and DROP TABLE keywords.
· Add and delete fields in an existing data table using the ADD COLUMN and DROP COLUMN keywords.
· Create and delete indexes using the CREATE INDEX and DROP INDEX keywords.
· Define table relationships including foreign keys using the PRIMARY KEY and FOREIGN KEY_REFERENCES keywords.
Throughout today's lesson, you'll use a program called SQL-VB. This is a Visual Basic program that processes SQL scripts. All the commands you learn today are in the form of SQL scripts. You can use the SQL-VB5 program without knowing much about how it was built. However, if you are curious about how SQL-VB5 works, you can refer to Appendix A, "The SQL-VB Project." This appendix walks you through a step-by-step construction of SQL-VB. It also contains information on how to use SQL-VB5 with this book and with other projects you create in the future.
Using the SQL-VB5 Interpreter
Before you begin today's lesson in advanced SQL commands, you'll take a quick tour of the SQL-VB5 program. You'll learn how to use SQL-VB5 to create, edit, and run SQL scripts. The SQL-VB5 Interpreter is a program that reads and executes SQL command scripts. You'll use this program throughout the lesson today. You might also find this program useful in the future for creating and managing SQL databases.
Loading and Running the SQL-VB5 Interpreter
To load the SQL-VB5 Interpreter, locate the TYSDBVB5\SOURCE\SQLVB5 directory that was created from the installation CD (for installation information, refer to the last page of this book). In the Windows Explorer or in File Manager, double-click on the SQLVB5.EXE file (this is a 32-bit application) to start the program. After the program loads, you should see a screen that looks similar to the one in Figure 13.1.
The opening screen is actually a multidocument interface. You can load and run one or more scripts from this interface. To test the system, load and run a simple test script. Using SQL-VB5, select File | Run, and at the Load SQLVB File dialog, locate and select SQLVB01.SQV (see Figure 13.2).

 
< previous page page_498 next page >

If you like this book, buy it!